home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 May
/
PCWorld_2000-05_cd.bin
/
Hardware
/
Drivers
/
tnt
/
Creative Support Driver Finder_soubory
/
dropmenus.js
< prev
next >
Wrap
Text File
|
2000-03-27
|
10KB
|
236 lines
// Drop-down menu v1.1
// -------------------
// Drop-down menus for Creative-Asia
//
// Revision history:
// 1.0 First version, simple show/hide of menu on mouseover
// 1.1 Current version, with "wipe down" transition for showing menu, "wipe up" transition for hiding menu.
//
// All menus should be defined with a <DIV> tag, with the visibility set to "hidden"
// The showmenu() function should then be called to make it visible.
// To hide the menu, call hidemenu()
//
// Setup defaults
if ( trans==null )
var trans=true;
if ( duration==null )
var duration=0.3;
menuOn=false;
document.onclick=hidemenu2;
// Test for Internet Explorer 4.0
function IsIE4() {
return ( navigator.appName == "Microsoft Internet Explorer" && parseInt( navigator.appVersion ) >= 4 );
}
// Shows the menu
function showmenu2( menuNum )
{
if ( IsIE4() ) {
var a=document.all.item("menu");
// Only allow mouseover to take place after the document is completely loaded
if ( document.readyState == "complete" ) {
hidemenu(); // Hide every other menu which might be displaying at this time
toggleFlash();
// Show the desired menu
if ( a(menuNum)) { // Check if the menu exists, if not, ignore
if ( a(menuNum).filters.item(0) && trans==true ) { // Only apply transition if its defined in the menu itself, otherwise, simply make it visible
a(menuNum).filters.item(0).transition=5; // Set Transition to "wipe down"
if ( a(menuNum).filters.item(0).status == 0 )
a(menuNum).filters.item(0).apply(); // Apply the transition effect
a(menuNum).style.visibility="visible"; // Set the final state of the menu (i.e. make it visible)
a(menuNum).filters.item(0).play( duration ); // "Play" the transition
}
else
a(menuNum).style.visibility="visible"; // Simply make the menu visible if it has no transition filters defined
}
}
menuOn=true;
return true;
}
}
// Hides the menu
function hidemenu2()
{
var a;
if ( IsIE4() ) {
if ( menuOn ) {
a=document.all.item("menu");
if ( a != null ) {
if ( a.length != null ) {
for (i=0; i<a.length; i++) {
menuNum=i;
if( a(menuNum).filters.item(0) && trans==true ) {
if ( a(menuNum).filters.item(0).status == 0 ) {
a(menuNum).filters.item(0).transition=4;
a(menuNum).filters.item(0).apply();
a(i).style.visibility="hidden";
a(menuNum).filters.item(0).play( duration );
}
else
a(i).style.visibility="hidden";
}
else
a(i).style.visibility="hidden";
}
}
}
}
else
return true;
}
menuOn=false;
return true;
}
// All the required menus should be defined here.
function drawmenus()
{
var s;
if ( IsIE4() ) {
// Products Menu
s= '<div id="menu" style="position:absolute; left:170; top:87; z-index:1; visibility:hidden; filter: revealtrans(duration=0.25, transition=5)">';
s += '<table cellpadding="4" cellspacing="1" border="0" width="115" BGCOLOR="#ff9933">';
s += '<tr>';
s += ' <td bgcolor="#ffffcc">';
s += ' <font face="Arial" size=1 class="dropmenutext">';
s += ' <a href="/sound/" class="dropmenuhighlite2">Audio</a><br>';
s += ' <a href="/speakers/" class="dropmenuhighlite2">Speakers</a><br>';
s += ' <a href="/digital-audio/" class="dropmenuhighlite2">Digital Audio Player</a><br>';
s += ' <a href="/graphics/" class="dropmenuhighlite2">Graphics</a><br>';
s += ' <a href="/dvd/" class="dropmenuhighlite2">PC-DVD</a><br>';
s += ' <a href="/video/" class="dropmenuhighlite2">Video</a><br>';
s += ' <a href="/comms/" class="dropmenuhighlite2">Modems</a><br>';
s += ' <a href="/cd-drives/" class="dropmenuhighlite2">CD-RW & CD-ROM</a><br>';
s += ' <a href="/mmuk/" class="dropmenuhighlite2">Multimedia Kits</a><br>';
s += ' <a href="/hansvision/" class="dropmenuhighlite2">Chinese Software</a><br>';
s += ' <a href="/accessories/" class="dropmenuhighlite2">Accessories</a><br>';
s += ' </font>';
s += ' </td>';
s += '</tr>';
s += '</table>';
s += '</div>';
// Shopping Menu
s += '<div id="menu" style="position:absolute; left:210; top:87; z-index:1; visibility:hidden; filter: revealtrans(duration=0.25, transition=5)">';
s += '<table cellpadding="4" cellspacing="1" border="0" width="120" BGCOLOR="#ff9933">';
s += '<tr>';
s += ' <td bgcolor="#ffffcc">';
s += ' <font face="Arial" size=1 class="dropmenutext">';
s += ' <a href="/shopping/registration.html" class="dropmenuhighlite2">Registration</a><br>';
s += ' <a href="http://www.blasterpc.com.sg/msprotect/ncommerce3/ExecMacro/apg/selcountry.d2w/report?mode=shoppingcart" class="dropmenuhighlite2">Shopping Cart</a><br>';
s += ' <a href="http://www.blasterpc.com.sg/msprotect/ncommerce3/ExecMacro/apg/selcountry.d2w/report?mode=checkout" class="dropmenuhighlite2">Checkout</a><br>';
s += ' <a href="/shopping/custserv.html" class="dropmenuhighlite2">Customer Service</a><br>';
s += ' <hr color="#ff9933" size=1>';
s += ' <a href="/shopping/sound.html" class="dropmenuhighlite2">Sound</a><br>';
s += ' </font>';
s += ' </td>';
s += '</tr>';
s += '</table>';
s += '</div>';
// Support Menu
s += '<div id="menu" style="position:absolute; left:240; top:87; z-index:1; visibility:hidden; filter: revealtrans(duration=0.25, transition=5)">';
s += '<table cellpadding="4" cellspacing="1" border="0" width="120" BGCOLOR="#ff9933">';
s += '<tr>';
s += ' <td bgcolor="#ffffcc">';
s += ' <font face="Arial" size=1 class="dropmenutext">';
s += ' <a href="/support/drivers/" class="dropmenuhighlite2">Drivers</a><br>';
s += ' <a href="/support/faqs/" class="dropmenuhighlite2">FAQs</a><br>';
s += ' <a href="/support/manuals/" class="dropmenuhighlite2">Online Manuals</a><br>';
s += ' <a href="/support/specs/" class="dropmenuhighlite2">Technical Specs</a><br>';
s += ' <a href="/support/support.html" class="dropmenuhighlite2">Contact Us</a><br>';
s += ' </font>';
s += ' </td>';
s += '</tr>';
s += '</table>';
s += '</div>';
// Press Menu
s += '<div id="menu" style="position:absolute; left:295; top:87; z-index:1; visibility:hidden; filter: revealtrans(duration=0.25, transition=5)">';
s += '<table cellpadding="4" cellspacing="1" border="0" width="120" BGCOLOR="#ff9933">';
s += '<tr>';
s += ' <td bgcolor="#ffffcc">';
s += ' <font face="Arial" size=1 class="dropmenutext">';
s += ' <a href="/press/2000/" class="dropmenuhighlite2">2000 Releases</a><br>';
s += ' <a href="/press/1999/" class="dropmenuhighlite2">1999 Releases</a><br>';
s += ' <a href="/press/1998/" class="dropmenuhighlite2">1998 Releases</a><br>';
s += ' <a href="/press/1997" class="dropmenuhighlite2">1997 Releases</a><br>';
s += ' <a href="/press/pfact/index.html" class="dropmenuhighlite2">Product Info</a><br>';
s += ' <hr color="#ff9933" size=1>';
s += ' <a href="/press/backgrounder.html" class="dropmenuhighlite2">Backgrounder</a><br>';
s += ' <a href="/press/fact-sheet.html" class="dropmenuhighlite2">Fact Sheet</a><br>';
s += ' <a href="/press/milestones/1999.html" class="dropmenuhighlite2">Milestones</a><br>';
s += ' <a href="/press/subsidiaries/asia.html" class="dropmenuhighlite2">Subsidiaries</a><br>';
s += ' <a href="/press/awards/2000.html" class="dropmenuhighlite2">Awards</a><br>';
s += ' </font>';
s += ' </td>';
s += '</tr>';
s += '</table>';
s += '</div>';
// Jobs Menu
s += '<div id="menu" style="position:absolute; left:350; top:87; z-index:1; visibility:hidden; filter: revealtrans(duration=0.25, transition=5)">';
s += '<table cellpadding="4" cellspacing="1" border="0" width="120" BGCOLOR="#ff9933">';
s += '<tr>';
s += ' <td bgcolor="#ffffcc">';
s += ' <font face="Arial" size=1 class="dropmenutext">';
s += ' <a href="/jobs/mission.html" class="dropmenuhighlite2">Vision & Mission</a><br>';
s += ' <a href="/jobs/culture.html" class="dropmenuhighlite2">Creative Culture</a><br>';
s += ' <a href="/jobs/" class="dropmenuhighlite2">Join Our Family</a><br>';
s += ' <a href="/jobs/resume.html" class="dropmenuhighlite2">Online Resume</a><br>';
s += ' <a href="/jobs/hq.html" class="dropmenuhighlite2">Singapore HQ</a><br>';
s += ' <a href="/jobs/map.html" class="dropmenuhighlite2">How to Get Here</a><br>';
s += ' </font>';
s += ' </td>';
s += '</tr>';
s += '</table>';
s += '</div>';
// Feedback Menu
s += '<div id="menu" style="position:absolute; left:400; top:87; z-index:1; visibility:hidden; filter: revealtrans(duration=0.25, transition=5)">';
s += '<table cellpadding="4" cellspacing="1" border="0" width="140" BGCOLOR="#ff9933">';
s += '<tr>';
s += ' <td bgcolor="#ffffcc">';
s += ' <font face="Arial" size=1 class="dropmenutext">';
s += ' <a href="/feedback/support.html" class="dropmenuhighlite2">Technical Support</a><br>';
s += ' <a href="/feedback/disty.html" class="dropmenuhighlite2">Be a Dealer/Distributor</a><br>';
s += ' <a href="/feedback/webmaster.html" class="dropmenuhighlite2">Webmaster</a><br>';
s += ' <a href="/feedback/suggestions.html" class="dropmenuhighlite2">Suggestions</a><br>';
s += ' </font>';
s += ' </td>';
s += '</tr>';
s += '</table>';
s += '</div>';
document.write( s );
}
}
function toggleFlash( n )
{
if ( document.all("staticImg") && document.all("flash") ) {
if ( n==1 ) {
staticImg.style.display="none";
flash.style.display="block";
}
else {
staticImg.style.display="block";
flash.style.display="none";
}
}
}